﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using lnxsj.web.Recruitment.Models;

namespace lnxsj.web.Recruitment.Controllers
{
    public class EmployController : Controller
    {
        private RecrunitmenutDB db = new RecrunitmenutDB();

        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Create(Employ employ)
        {
            if (ModelState.IsValid)
            {
                employ.填表时间 = DateTime.Now;
                db.Employs.Add(employ);
                db.SaveChanges();

                return RedirectToAction("CreateResult");
            }

            return View("~/home/index",employ);
        }

        public ActionResult CreateResult() {
            return View("Result");
        }

        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
    }
}